package com.zjw.mapper;

import com.zjw.entity.po.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    //通过wid查询user对象是否存在
    @Select(" select * from user where wid=#{wid}")
    User selectUserByWid(int wid);

    //通过邮箱查询user对象是否存在
    @Select(" select * from user where email=#{email}")
    User selectUserByEmail(String email);

    @Update(" update user set wid=#{wid} where email=#{email}")
    int updateWidByEmail(Integer wid,String email);

}